unit FindBookByID;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Db, Mask, DBCtrls, StdCtrls;

type
  TfmFindBookByID = class(TForm)
    GroupBox1: TGroupBox;
    edID: TEdit;
    DBEdit1: TDBEdit;
    DBEdit2: TDBEdit;
    DBEdit3: TDBEdit;
    DBEdit4: TDBEdit;
    DataSource1: TDataSource;
    procedure edIDKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

implementation

{$R *.DFM}
uses DataModule;
procedure TfmFindBookByID.edIDKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if Key = VK_RETURN then
    begin
      if dmData.qFindBooks.Active then dmData.qFindReaders.Close;
      with dmData.qFindBooks do
        begin
          Params[0].Value := StrToInt((Sender as TEdit).Text);
          Prepare;
          Open;
        end;
    end;
end;

end.
